package it.poli.IA.space;

import it.poli.IA.exceptions.UndefinedComparatorException;

import java.util.Comparator;


public class Node {

	protected State currentState;
	protected Node parentNode;
	protected Action pastAction;
	protected Integer totalCost;
	
	public Node()
	{
		
	}
	
	public Node(State currenteState, Node parentNode, Action pastAction, Integer totalCost)
	{
		this.currentState = currenteState;
		this.parentNode = parentNode;
		this.pastAction = pastAction;
		this.totalCost = totalCost;
	}
	
	@Override
	public String toString() {
		return this.currentState.toString();
	}
	
	public State getCurrentState()
	{
		return currentState;
	}
	
	public void setCurrentState(State currentState) 
	{
		this.currentState = currentState;
	}
	
	public Node getParentNode() 
	{
		return parentNode;
	}
	
	public void setParentNode(Node parentNode)
	{
		this.parentNode = parentNode;
	}
	
	public Integer getTotalCost() 
	{
		return totalCost;
	}
	
	public void setTotalCost(Integer totalCost) 
	{
		this.totalCost = totalCost;
	}
	
	public Action getPastAction() 
	{
		return pastAction;
	}
	
	public void setPastAction(Action pastAction)
	{
		this.pastAction = pastAction;
	}

	
	public Comparator<? super Node> getComparator() throws UndefinedComparatorException {
		throw new UndefinedComparatorException();
		
	}
	
}
